package com.freecloud.plug.mybatis.plugins;

import org.apache.ibatis.exceptions.PersistenceException;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.defaults.DefaultSqlSession;

/**
 * @Author: maomao
 * @Date: 2021-04-29 19:55
 */
public class CustomSqlSession extends DefaultSqlSession {
    public CustomSqlSession(Configuration configuration, Executor executor, boolean autoCommit) {
        super(configuration, executor, autoCommit);
    }

    public CustomSqlSession(Configuration configuration, Executor executor) {
        super(configuration, executor);
    }

    @Override
    public int update(String statement, Object parameter) {
        try {
            return super.update(statement, parameter);
        } catch (PersistenceException me) {
            System.out.println("333333333");
            throw me;
        } catch (Exception e) {
            throw e;
        }
    }
}
